<?php
include "../../db_const.php";
include "../../connect.php";
include "../../connect_ado.php";
//include "../../onegate_function.php";
//*****************************************************************************************************************
//	V1.0	ChungNT	Kiem tra so ten cua hang da ton tai chua
//*****************************************************************************************************************
	$ten_ho_kinh_doanh = $_REQUEST['id'];
//	$ten_ho_kinh_doanh = createStringToCheckValueOfSearch($ten_ho_kinh_doanh);
//	$array_thkd = split(',',$ten_ho_kinh_doanh);
		
	$tp   = $_REQUEST['type'];
	$sql = "select count(*) from T_ONEGATE_RECORD WHERE dbo.f_GetValueOfXMLtag(C_RECEIVED_RECORD_XML_DATA, 'ten_ho_kinh_doanh') like N'".$ten_ho_kinh_doanh."' AND FK_RECORDTYPE like '001' AND C_CURRENT_STATUS IN ('CAP_PHEP')";

//	$sql = "SELECT count(*) FROM T_ONEGATE_RECORD WHERE dbo.f_GetValueOfXMLtag(C_RECEIVED_RECORD_XML_DATA, 'ten_ho_kinh_doanh') = '".$array_thkd[0]."' OR dbo.f_GetValueOfXMLtag(C_RECEIVED_RECORD_XML_DATA, 'ten_ho_kinh_doanh') = '".$array_thkd[1]."' AND (FK_RECORDTYPE = '001')";
	$v_result = $ado_conn->GetRow($sql);
	echo($v_result[0]);
?>